
#ifndef __BINARY_TREE_H__
#define __BINARY_TREE_H__
/*节点*/
typedef struct BsTreeNode
{
	int data;//存储有效数据
	struct BsTreeNode *left;//左子树地址
	struct BsTreeNode *right;//右子树地址
}BSTREE_NODE;
/*代表树*/
typedef struct BsTree
{
	BSTREE_NODE *root;/*指向树的根节点*/
	int  size;/*记录节点的个数*/
}BSTREE;
/*创建空树*/
BSTREE *bstree_create(void);
/*销毁树*/
void bstree_destroy(BSTREE *bstree);
/*插入节点*/
void bstree_insert(BSTREE *bstree, int data);
/*按树型打印相应的节点*/
void bstree_print(BSTREE *bstree);
void bstree_midtravel(BSTREE *bstree);
void midtravel(BSTREE_NODE *root);
void bstree_pretravel(BSTREE *bstree);
void pertravel(BSTREE_NODE *root);
void bstree_postravel(BSTREE *bstree);
void postravel(BSTREE_NODE *root);
#endif

